<template>
	<view class="content">
		
		<view class="rows" v-for="(item,index) in sysList" :key="index" @tap="TapDetails(index)">
			<image class="icon" :src="item.cover" mode=""></image>
			<view class="right">
				<view class="overflow_one title">
					{{item.title}}
					<view class="time">{{item.createtime}}</view>
				</view>
				<view class="overflow_one contents">{{item.content}}</view>
			</view>
			<view class="clearBoth"></view>
		</view>
		
	</view>
</template>
<style>
	.content{width:100%;height:100vh;overflow-y: scroll;}
	.content .rows{width:95%;margin-left: 2.5%;padding:2.5%;}
	.content .rows .icon{width:76upx;height:76upx;float: left;margin-right: 20upx;}
	.content .rows .right{width:84%;float: left;}
	.content .rows .time{width:auto;float: right;color:#BCBCBC;font-size: 22upx;}
	.content .rows .right .title{width:100%;color:#000000;font-size: 28upx;}
	.content .rows .right .contents{width:100%;font-size: 22upx;color:#BCBCBC;margin-top: 10upx;}
</style>
<script>
	import Share from '@/common/wx_share.js'
	export default {
		data() {
			return {
				share:{
					title:"",
					path:'/pages/tabbar/msg',
					imageUrl:'',
					desc:'',
					content:''
				},
				sysList:[
					{cover:"/static/msg/icon_1.png",createtime:"",title:"系统通知",content:""},
					{cover:"/static/msg/icon_2.png",createtime:"",title:"小程序官方客服",content:"点击询问"},
				],
				pages:1
			}
		},
		onShow(){
			// this.sysList = []
			this.AjaxLoad()
		},
		methods: {
			AjaxLoad(){
				var sysList = []
				let param={
					token:this._$userToken("userInfo").token,
					page:this.pages
				};
				this._$InitRequest.request("member_info/msg", param).then(res => {
					this.sysList[0].createtime = res.data.last.create_time
					this.sysList[0].content = res.data.last.title
					// res.data.forEach( (item) =>{
					// 	sysList.push({
					// 		id:item.id,
					// 		title:item.title,
					// 		createtime:item.createtime,
					// 		is_read:item.is_read,
					// 		show:true,
					// 		options: [{
					// 			text: '删除',
					// 			style: {
					// 				backgroundColor: 'rgb(255,58,49)'
					// 			}
					// 		}],
					// 	})
					// })
					// for (var i = 0; i < sysList.length; i++){this.sysList.push( sysList[i] )}
					// if( this.sysList.length == 0 ){
					// 	this.NoneName = "暂无消息"
					// }
				},error=>{})
			},
			TapDetails(index){
				if( index == 0 ){
					uni.navigateTo({
						url:"/pages_msg/pages/msgList/msgList"
					})
				}
			},
			
		}
	}
</script>
<style lang="scss" scoped>
/deep/ .uni-input-input {font-size:32upx}
/deep/ .uni-radio-input-checked{background-color:rgb(110,43,34) !important;border:2upx solid white !important}
.content .html{
  ::v-deep {
    img {
      width: 100%;
    }
  }
}
</style>